package com.vic.test.designpattern._3singletonpattern;


//表面上看起来差别挺大，其实更第三种方式差不多，都是在类初始化即实例化instance
public class SingletonHungry2 {//饿汉，变种
    private static SingletonHungry2 instance = null;
    static{
        instance = new SingletonHungry2();
    }
    private SingletonHungry2(){}
    public static SingletonHungry2 getInstance(){
        return instance;
    }

}
